3.44 \(\int \frac{\sin ^2(c+d x)}{a-a \sin ^2(c+d x)} \, dx\)

Optimal. Leaf size=20 \[ \frac{\tan (c+d x)}{a d}-\frac{x}{a} \]

[Out]

-(x/a) + Tan[c + d*x]/(a*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0631069, antiderivative size = 20, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3171, 3175, 3767, 8} \[ \frac{\tan (c+d x)}{a d}-\frac{x}{a} \]

Antiderivative was successfully verified.

[In]

Int[Sin[c + d*x]^2/(a - a*Sin[c + d*x]^2),x]

[Out]

-(x/a) + Tan[c + d*x]/(a*d)

Rule 3171

Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)]^2)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(B*x
)/b, x] + Dist[(A*b - a*B)/b, Int[1/(a + b*Sin[e + f*x]^2), x], x] /; FreeQ[{a, b, e, f, A, B}, x]

Rule 3175

Int[(u_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Dist[a^p, Int[ActivateTrig[u*cos[e + f*x
]^(2*p)], x], x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0] && IntegerQ[p]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\sin ^2(c+d x)}{a-a \sin ^2(c+d x)} \, dx &=-\frac{x}{a}+\int \frac{1}{a-a \sin ^2(c+d x)} \, dx\\ &=-\frac{x}{a}+\frac{\int \sec ^2(c+d x) \, dx}{a}\\ &=-\frac{x}{a}-\frac{\operatorname{Subst}(\int 1 \, dx,x,-\tan (c+d x))}{a d}\\ &=-\frac{x}{a}+\frac{\tan (c+d x)}{a d}\\ \end{align*}

Mathematica [A]  time = 0.0136556, size = 27, normalized size = 1.35 \[ \frac{\frac{\tan (c+d x)}{d}-\frac{\tan ^{-1}(\tan (c+d x))}{d}}{a} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[c + d*x]^2/(a - a*Sin[c + d*x]^2),x]

[Out]

(-(ArcTan[Tan[c + d*x]]/d) + Tan[c + d*x]/d)/a

________________________________________________________________________________________

Maple [A]  time = 0.038, size = 30, normalized size = 1.5 \begin{align*}{\frac{\tan \left ( dx+c \right ) }{da}}-{\frac{\arctan \left ( \tan \left ( dx+c \right ) \right ) }{da}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(d*x+c)^2/(a-sin(d*x+c)^2*a),x)

[Out]

tan(d*x+c)/d/a-1/d/a*arctan(tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.42814, size = 35, normalized size = 1.75 \begin{align*} -\frac{\frac{d x + c}{a} - \frac{\tan \left (d x + c\right )}{a}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^2/(a-a*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

-((d*x + c)/a - tan(d*x + c)/a)/d

________________________________________________________________________________________

Fricas [A]  time = 1.61839, size = 74, normalized size = 3.7 \begin{align*} -\frac{d x \cos \left (d x + c\right ) - \sin \left (d x + c\right )}{a d \cos \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^2/(a-a*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

-(d*x*cos(d*x + c) - sin(d*x + c))/(a*d*cos(d*x + c))

________________________________________________________________________________________

Sympy [A]  time = 7.73582, size = 100, normalized size = 5. \begin{align*} \begin{cases} - \frac{d x \tan ^{2}{\left (\frac{c}{2} + \frac{d x}{2} \right )}}{a d \tan ^{2}{\left (\frac{c}{2} + \frac{d x}{2} \right )} - a d} + \frac{d x}{a d \tan ^{2}{\left (\frac{c}{2} + \frac{d x}{2} \right )} - a d} - \frac{2 \tan{\left (\frac{c}{2} + \frac{d x}{2} \right )}}{a d \tan ^{2}{\left (\frac{c}{2} + \frac{d x}{2} \right )} - a d} & \text{for}\: d \neq 0 \\\frac{x \sin ^{2}{\left (c \right )}}{- a \sin ^{2}{\left (c \right )} + a} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)**2/(a-a*sin(d*x+c)**2),x)

[Out]

Piecewise((-d*x*tan(c/2 + d*x/2)**2/(a*d*tan(c/2 + d*x/2)**2 - a*d) + d*x/(a*d*tan(c/2 + d*x/2)**2 - a*d) - 2*
tan(c/2 + d*x/2)/(a*d*tan(c/2 + d*x/2)**2 - a*d), Ne(d, 0)), (x*sin(c)**2/(-a*sin(c)**2 + a), True))

________________________________________________________________________________________

Giac [A]  time = 1.17535, size = 35, normalized size = 1.75 \begin{align*} -\frac{\frac{d x + c}{a} - \frac{\tan \left (d x + c\right )}{a}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^2/(a-a*sin(d*x+c)^2),x, algorithm="giac")

[Out]

-((d*x + c)/a - tan(d*x + c)/a)/d